<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>SPI_finish</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="REFENTRY">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="spi-spi-connect.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="spi-spi-connect.html">快退</a></td><td width="60%" align="center" valign="bottom"></td><td width="10%" align="right" valign="top"><a href="spi-spi-push.html">快进</a></td><td width="10%" align="right" valign="top"><a href="spi-spi-push.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<h1><a name="SPI-SPI-FINISH"></a>SPI_finish</h1>
<div class="REFNAMEDIV"><a name="AEN41906"></a><h2>函数名</h2>SPI_finish&nbsp;--&nbsp;把一个过程与 SPI 管理器断开</div>
<a name="AEN41909"></a>
<div class="REFSYNOPSISDIV"><a name="AEN41911"></a><h2>原型</h2>
<pre class="SYNOPSIS">int SPI_finish(void)</pre>
</div>
<div class="REFSECT1"><a name="AEN41913"></a><h2>描述</h2>
<p><code class="FUNCTION">SPI_finish</code> 关闭一个现有的与 SPI 管理器的连接。在完成你的过程的当前调用锁必须的 SPI 操作之后，你必须调用这个函数。不过，如果你通过 <tt class="LITERAL">elog(ERROR)</tt> 退出事务，那么你就不需要担心这件事情。在这种情况下，SPI 将自动清理干净。</p>
<p>如果 <code class="FUNCTION">SPI_finish</code> 是在当前没有有效连接的情况下被调用的，你可能会得到一个 <tt class="SYMBOL">SPI_ERROR_UNCONNECTED</tt> 的返回。这样做没有什么根本性问题，这意味着 SPI 管理器不做任何事情。</p>
</div>
<div class="REFSECT1"><a name="AEN41921"></a><h2>返回值</h2>
<div class="VARIABLELIST">
<dl>
<dt><tt class="SYMBOL">SPI_OK_FINISH</tt></dt>
<dd><p>如果正常断开</p></dd>
<dt><tt class="SYMBOL">SPI_ERROR_UNCONNECTED</tt></dt>
<dd><p>如果从一个未连接的过程调用</p></dd>
</dl>
</div>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="spi-spi-connect.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="spi-spi-push.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top">SPI_connect</td><td width="34%" align="center" valign="top"><a href="spi-interface.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">SPI_push</td></tr>
</table>
</div>
</body></html>